<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>商户列表</h2>
    </div>
    <div class="cf">
        <if condition="$group_id neq 10">
        <div class="fl">
            <button class="btn ajax-post" url="{:U('Shop/changeStatus',array('method'=>'resumeUser'))}" target-form="ids">启 用</button>
            <button class="btn ajax-post" url="{:U('Shop/changeStatus',array('method'=>'forbidUser'))}" target-form="ids">禁 用</button>
            <button class="btn ajax-post confirm" id="ids_fore" onClick="foreverdel(0,'/Admin/Goods');" target-form="ids">删 除</button>
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <form action="/Admin/Usermember/index" id="form1" method="get">
                <div class="sleft">
                    <!--<input type="text" name="typeid" class="search-input" value="" placeholder="文件分类">-->
                    <select class="search-input" name="user_type">
                        <option value="">请选择分组</option>
                        <volist name="userfz" id="typelist">
                            <option value="{$typelist.id}" <?php if($_GET['user_type']==$typelist[id]){echo 'selected';} ?>>{$typelist.title}</option>
                        </volist>
                    </select>
                    <input type="text" name="title" class="search-input" value="{$get[title]}" placeholder="标题">
                    <a class="sch-btn" href="javascript:;" id="search" ><i class="btn-search"></i></a>
                </div>
            </form>
        </div>
        </if>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table class="">
            <thead>
            <tr>
                <th class="row-selected row-selected" ><input class="check-all" type="checkbox"/></th>
                <th class="" >编号</th>
                <th class="" >商家名称</th>
                <th class="" >详细地址</th>
                <th class="" >所属行业</th>
                <th class="" >商家介绍</th>
                <th class="" >商家logo</th>
                <th class="" >商家相册</th>
                <th class="" >联系电话</th>
                <th class="" >联系人</th>
                <th class="" >职位</th>
                <th class="" >所在地区</th>
                <th class="" >优质商家</th>
                <th class="" >状态</th>
                <th class="" >操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="list">
                <volist name="list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
                        <td>{$vo.id} </td>
                        <td>{$vo.shop_name}</td>
                        <td>{$vo.shop_address}</td>
                        <td>{$vo.type}</td>
                        <td>{$vo.introduce}</td>
                        <td>{$vo.shop_logo}</td>
                        <td>{$vo.shop_thumb}</td>
                        <td>{$vo.phone}</td>
                        <td>{$vo.contacts}</td>
                        <td>{$vo.position}</td>
                        <td>{$vo.shop_area}</td>
                        <td><if condition="$vo[hq_shop] eq 1">否
                            <if condition="$group_id neq 10"><a href="{:U('Shop/hq_shop?hq_shop=2&id='.$vo['id'])}" class="ajax-get">成为优质商家</a>
                            </if>
                            <else/>是
                            <if condition="$group_id neq 10">
                                <a href="{:U('Shop/hq_shop?hq_shop=1&id='.$vo['id'])}" class="ajax-get">解除优质商家</a>
                            </if>
                        </if>
                        </td>
                        <td><if condition="$vo[status] eq 1">正常<else/>禁用</if></td>
                        <td>
                            <a href="{:U('Shop/edit?id='.$vo['id'])}">装修店铺</a>
                            <if condition="$group_id neq 10">
                            <eq name="vo.status" value="1">
                                <a href="{:U('Shop/changeStatus?method=forbidUser&id='.$vo['id'])}" class="ajax-get">禁用</a>
                                <else/>
                                <a href="{:U('Shop/changeStatus?method=resumeUser&id='.$vo['id'])}" class="ajax-get">启用</a>
                            </eq>
                                <a href="{:U('Shop/changeStatus?method=deleteuser&id='.$vo['id'])}" class="confirm ajax-get">删除</a>
                            </if>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script src="__STATIC__/layer/layer.js"></script>

    <script type="text/javascript">
        //搜索功能
        $("#search").click(function(){
            $("#form1").submit();
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav('{:U('Shop/index')}');
    </script>
</block>
